Online-Academy
Look, Read, Understand, Apply

Data Mining And Data Warehousing

Star Schema

Star Schema

A Star Schema is a type of database schema used in data warehousing that organizes data into fact and dimension tables to optimize query performance and ease of use.

Components:

Fact Table:
Central table.
  • Contains measurable, quantitative data (e.g., sales, revenue).
  • Has foreign keys referencing dimension tables.
Dimension Tables:
  • Surround the fact table (hence "star").
  • Contain descriptive attributes (e.g., date, product, customer, location).
  • Used for filtering, grouping, and labeling.

Example:

Imagine a retail sales database:
  • Fact Table: Sales (sales_id, product_id, customer_id, date_id, store_id, sales_amount)

Dimension Tables:

  • Product (product_id, product_name, category)
  • Customer (customer_id, name, region)
  • Date (date_id, day, month, year)
  • Store (store_id, store_name, location)